<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:forEach var="t" items="${pageInfo.list}" varStatus="status">
    <tr>
	  <td><input type="checkbox" name="idCheckbox" value="${t.id}" lay-skin="primary"></td>
	  <td>${t.username}</td>
	  <td>${t.accountname}</td>
	  <td>${t.description}</td>
	  <td style="min-width:165px;"><fmt:formatDate value="${t.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	  <td style="min-width:60px;">
	  	<c:if test="${t.status==0}">
	  		正常
	  	</c:if>
	  	<c:if test="${t.status==1}">
	  		禁用
	  	</c:if>
	  </td>
	  <td style="text-align: center;">
	  		<!-- 不允许编辑超级管理员 -->
	  	  <c:if test="${t.accountname!='sysadmin'}">
			  <div class="layui-btn-group" style="width: 224px;">
			    <button class="layui-btn layui-btn-small" onclick="sysuserUpdatePage(${t.id})">编辑</button>
			    <button class="layui-btn layui-btn-small" onclick="sysuserRoleUpdatePage(${t.id})">角色</button>
			    <button class="layui-btn layui-btn-small" onclick="sysuserResourcesUpdatePage(${t.id})">权限</button>
			    <c:if test="${t.status==1}">
				    <button onclick="sysuserUpadateStatus(${t.id},0);" class="layui-btn layui-btn-normal layui-btn-small">启用</button>
			  	</c:if>
			  	<c:if test="${t.status==0}">
				    <button onclick="sysuserUpadateStatus(${t.id},1);" class="layui-btn layui-btn-warm layui-btn-small">禁用</button>
			  	</c:if>
			    <button onclick="sysuserDelete(${t.id},'${t.username}','${t.accountname}')" class="layui-btn layui-btn-danger layui-btn-small">删除</button>
			  </div>
		  </c:if>
  	  </td>
	</tr>
</c:forEach>
<script>
var pageNum = "${pageInfo.pageNum}";
var total = "${pageInfo.total}";
var pages = "${pageInfo.pages}";
</script>
<script src="${pageContext.request.contextPath}/static/js/back/sysuser/sysuserPageList.js"></script>
